package com.peter.design.pattern.proxy.dynamicproxy.jdk;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * @Auther: 肖冬
 * @Date: 2020/7/26 19:52
 * @Description:
 */
public class JDKProxyTest {

    public static void main(String[] args) {
        try {
            Object proxyInstance = new JDKMeipo().getInstance(new Girl());
            Method method = proxyInstance.getClass().getMethod("findLove", null);
            method.invoke(proxyInstance);
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }
    }
}
